package com.hua.api.core.activemq.consumer.event.impl;

import com.alibaba.fastjson.JSONObject;
import com.hua.api.core.activemq.consumer.event.ActiveMqEvent;
import com.hua.api.core.activemq.consumer.event.EventConstant;
import com.hua.api.modules.home.service.MessageService;
import com.hua.api.modules.home.service.impl.SmsMessageServiceImpl;
import com.hua.api.modules.home.service.impl.WxMessageServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

// 订单确认
@Component(EventConstant.event_logistics_start)
public class LogisticwStartEvent implements ActiveMqEvent {

    @Autowired
    private WxMessageServiceImpl wxMessageService;

    @Autowired
    private SmsMessageServiceImpl smsMessageService;

    @Override
    public void doEvent(JSONObject data) {

        List<MessageService> list = new ArrayList<>();
        list.add(wxMessageService);
        // list.add(smsMessageService);

        for(MessageService messageService:list){
            messageService.sendMessage(data,EventConstant.event_logistics_start);
        }
        
    }



}
